<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- Attribute.cpp -->
  <meta name="description" content="驱动属性集.">
  <title>Attribute Class | OpenVisa 0.15.0</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
    <div class="main">
    <div class="main-rounded">
        <div class="navigationbar">
        <ul>
<li><a href="index.html">OpenVisa 0.15.0</a></li>
<li><a href="openvisa-module.html" translate="no">OpenVisa</a></li>
<li>Attribute</li>
<li id="buildversion">OpenVisa 0.15.0 Reference Documentation</li>
    </ul>
    </div>
</div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3 id="toc">Contents</h3>
<ul>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title" translate="no">Attribute Class</h1>
<span class="small-subtitle" translate="no">class <a href="openvisa-module.html" translate="no">OpenVisa</a>::<a href="openvisa-object.html" translate="no">Object</a>::Attribute</span>
<!-- $$$Attribute-brief -->
<p>驱动属性集. <a href="#details">More...</a></p>
<!-- @@@Attribute -->
<ul>
<li><a href="openvisa-object-attribute-members.html">List of all members, including inherited members</a></li>
</ul>
<h2 id="public-functions">Public Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#autoAppendTerminalChars" translate="no">autoAppendTerminalChars</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> unsigned int </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#baudRate" translate="no">baudRate</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#commandVerify" translate="no">commandVerify</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> OpenVisa::DataBits </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#dataBits" translate="no">dataBits</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const std::string &amp;</td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#deviceName" translate="no">deviceName</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> OpenVisa::FlowControl </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#flowControl" translate="no">flowControl</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> OpenVisa::Parity </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#parity" translate="no">parity</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setAutoAppendTerminalChars" translate="no">setAutoAppendTerminalChars</a></b>(bool <i>en</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setBaudRate" translate="no">setBaudRate</a></b>(unsigned int <i>baud</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setCommandVerify" translate="no">setCommandVerify</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setDataBits" translate="no">setDataBits</a></b>(OpenVisa::DataBits <i>bits</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setDeviceName" translate="no">setDeviceName</a></b>(std::string_view <i>name</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setFlowControl" translate="no">setFlowControl</a></b>(OpenVisa::FlowControl <i>fc</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setParity" translate="no">setParity</a></b>(OpenVisa::Parity <i>p</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setStopBits" translate="no">setStopBits</a></b>(OpenVisa::StopBits <i>bits</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setTerminalChars" translate="no">setTerminalChars</a></b>(std::string_view <i>chars</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setTerminalCharsEnable" translate="no">setTerminalCharsEnable</a></b>(bool <i>enable</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#setTimeout" translate="no">setTimeout</a></b>(const std::chrono::milliseconds &amp;<i>timeout</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> OpenVisa::StopBits </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#stopBits" translate="no">stopBits</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const std::string &amp;</td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#terminalChars" translate="no">terminalChars</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#terminalCharsEnable" translate="no">terminalCharsEnable</a></b>() const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const std::chrono::milliseconds &amp;</td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#timeout" translate="no">timeout</a></b>() const</td></tr>
</table></div>
<h2 id="protected-functions">Protected Functions</h2>
<div class="table"><table class="alignedsummary" translate="no">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#Attribute" translate="no">Attribute</a></b>(std::shared_ptr&lt;OpenVisa::IOBase&gt; *<i>io</i>)</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="openvisa-object-attribute.html#dtor.Attribute" translate="no">~Attribute</a></b>()</td></tr>
</table></div>
<!-- $$$Attribute-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
</div>
<!-- @@@Attribute -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$Attribute[overload1]$$$Attributestd::shared_ptr<OpenVisa::IOBase>* -->
<h3 class="fn" translate="no" id="Attribute"><code class="details extra" translate="no">[protected]</code> Attribute::<span class="name">Attribute</span>(<span class="type">std::shared_ptr</span>&lt;<span class="type">OpenVisa::IOBase</span>&gt; *<i>io</i>)</h3>
<p>构造函数 <i translate="no">io</i>.</p>
<!-- @@@Attribute -->
<!-- $$$~Attribute[overload1]$$$~Attribute -->
<h3 class="fn" translate="no" id="dtor.Attribute"><code class="details extra" translate="no">[noexcept protected]</code> Attribute::<span class="name">~Attribute</span>()</h3>
<p>析构函数.</p>
<!-- @@@~Attribute -->
<!-- $$$autoAppendTerminalChars[overload1]$$$autoAppendTerminalChars -->
<h3 class="fn" translate="no" id="autoAppendTerminalChars"><span class="type">bool</span> Attribute::<span class="name">autoAppendTerminalChars</span>() const</h3>
<p>返回是否启用发送数据时是否自动添加终结符.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setAutoAppendTerminalChars" translate="no">setAutoAppendTerminalChars</a>.</p>
<!-- @@@autoAppendTerminalChars -->
<!-- $$$baudRate[overload1]$$$baudRate -->
<h3 class="fn" translate="no" id="baudRate"><span class="type">unsigned</span> <span class="type">int</span> Attribute::<span class="name">baudRate</span>() const</h3>
<p>返回波特率, 仅串口连接时有效，默认为9600.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setBaudRate" translate="no">setBaudRate</a>().</p>
<!-- @@@baudRate -->
<!-- $$$commandVerify[overload1]$$$commandVerify -->
<h3 class="fn" translate="no" id="commandVerify"><span class="type">bool</span> Attribute::<span class="name">commandVerify</span>() const</h3>
<p>返回是否启用指令验证.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setCommandVerify" translate="no">setCommandVerify</a>.</p>
<!-- @@@commandVerify -->
<!-- $$$dataBits[overload1]$$$dataBits -->
<h3 class="fn" translate="no" id="dataBits"><span class="type"><a href="openvisa.html#DataBits-enum" translate="no">OpenVisa::DataBits</a></span> Attribute::<span class="name">dataBits</span>() const</h3>
<p>返回数据位, 仅串口连接时有效, 默认为 <a href="openvisa.html#DataBits-enum" translate="no">DataBits::Data8</a>.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setDataBits" translate="no">setDataBits</a>.</p>
<!-- @@@dataBits -->
<!-- $$$deviceName[overload1]$$$deviceName -->
<h3 class="fn" translate="no" id="deviceName">const <span class="type">std::string</span> &amp;Attribute::<span class="name">deviceName</span>() const</h3>
<p>返回设备名称.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setDeviceName" translate="no">setDeviceName</a>.</p>
<!-- @@@deviceName -->
<!-- $$$flowControl[overload1]$$$flowControl -->
<h3 class="fn" translate="no" id="flowControl"><span class="type"><a href="openvisa.html#FlowControl-enum" translate="no">OpenVisa::FlowControl</a></span> Attribute::<span class="name">flowControl</span>() const</h3>
<p>返回流控制, 仅串口连接时有效，默认为 <a href="openvisa.html#FlowControl-enum" translate="no">FlowControl::None</a>.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setFlowControl" translate="no">setFlowControl</a>.</p>
<!-- @@@flowControl -->
<!-- $$$parity[overload1]$$$parity -->
<h3 class="fn" translate="no" id="parity"><span class="type"><a href="openvisa.html#Parity-enum" translate="no">OpenVisa::Parity</a></span> Attribute::<span class="name">parity</span>() const</h3>
<p>返回校验规则, 仅串口连接时有效，默认为 <a href="openvisa.html#Parity-enum" translate="no">Parity::None</a>.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setParity" translate="no">setParity</a>.</p>
<!-- @@@parity -->
<!-- $$$setAutoAppendTerminalChars[overload1]$$$setAutoAppendTerminalCharsbool -->
<h3 class="fn" translate="no" id="setAutoAppendTerminalChars"><span class="type">void</span> Attribute::<span class="name">setAutoAppendTerminalChars</span>(<span class="type">bool</span> <i>en</i>)</h3>
<p>设置是否启用发送数据时是否自动添加终结符 <i translate="no">en</i>, 默认为true.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#autoAppendTerminalChars" translate="no">autoAppendTerminalChars</a>.</p>
<!-- @@@setAutoAppendTerminalChars -->
<!-- $$$setBaudRate[overload1]$$$setBaudRateunsignedint -->
<h3 class="fn" translate="no" id="setBaudRate"><span class="type">void</span> Attribute::<span class="name">setBaudRate</span>(<span class="type">unsigned</span> <span class="type">int</span> <i>baud</i>)</h3>
<p>设置波特率 <i translate="no">baud</i>, 仅串口连接时有效.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#baudRate" translate="no">baudRate</a>.</p>
<!-- @@@setBaudRate -->
<!-- $$$setCommandVerify[overload1]$$$setCommandVerifybool -->
<h3 class="fn" translate="no" id="setCommandVerify"><span class="type">void</span> Attribute::<span class="name">setCommandVerify</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>设置是否启用指令验证 <i translate="no">enable</i>.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#commandVerify" translate="no">commandVerify</a>.</p>
<!-- @@@setCommandVerify -->
<!-- $$$setDataBits[overload1]$$$setDataBitsOpenVisa::DataBits -->
<h3 class="fn" translate="no" id="setDataBits"><span class="type">void</span> Attribute::<span class="name">setDataBits</span>(<span class="type"><a href="openvisa.html#DataBits-enum" translate="no">OpenVisa::DataBits</a></span> <i>bits</i>)</h3>
<p>设置数据位 <i translate="no">bits</i>, 仅串口连接时有效.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#dataBits" translate="no">dataBits</a>.</p>
<!-- @@@setDataBits -->
<!-- $$$setDeviceName[overload1]$$$setDeviceNamestd::string_view -->
<h3 class="fn" translate="no" id="setDeviceName"><span class="type">void</span> Attribute::<span class="name">setDeviceName</span>(<span class="type">std::string_view</span> <i>name</i>)</h3>
<p>设置设备名称 <i translate="no">name</i>, 该设置不是必须的，如果设置了设备名称，抛出异常时， 异常描述将以该设备名称为前缀，用于多台设备控制时的区分，若未设置设备名，则抛出的异常描述无前缀.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#deviceName" translate="no">deviceName</a>.</p>
<!-- @@@setDeviceName -->
<!-- $$$setFlowControl[overload1]$$$setFlowControlOpenVisa::FlowControl -->
<h3 class="fn" translate="no" id="setFlowControl"><span class="type">void</span> Attribute::<span class="name">setFlowControl</span>(<span class="type"><a href="openvisa.html#FlowControl-enum" translate="no">OpenVisa::FlowControl</a></span> <i>fc</i>)</h3>
<p>设置流控制 <i translate="no">fc</i>, 仅串口连接时有效.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#flowControl" translate="no">flowControl</a>.</p>
<!-- @@@setFlowControl -->
<!-- $$$setParity[overload1]$$$setParityOpenVisa::Parity -->
<h3 class="fn" translate="no" id="setParity"><span class="type">void</span> Attribute::<span class="name">setParity</span>(<span class="type"><a href="openvisa.html#Parity-enum" translate="no">OpenVisa::Parity</a></span> <i>p</i>)</h3>
<p>设置校验规则 <i translate="no">p</i>, 仅串口连接时有效.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#parity" translate="no">parity</a>.</p>
<!-- @@@setParity -->
<!-- $$$setStopBits[overload1]$$$setStopBitsOpenVisa::StopBits -->
<h3 class="fn" translate="no" id="setStopBits"><span class="type">void</span> Attribute::<span class="name">setStopBits</span>(<span class="type"><a href="openvisa.html#StopBits-enum" translate="no">OpenVisa::StopBits</a></span> <i>bits</i>)</h3>
<p>设置停止位 <i translate="no">bits</i>, 仅串口连接时有效.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#stopBits" translate="no">stopBits</a>.</p>
<!-- @@@setStopBits -->
<!-- $$$setTerminalChars[overload1]$$$setTerminalCharsstd::string_view -->
<h3 class="fn" translate="no" id="setTerminalChars"><span class="type">void</span> Attribute::<span class="name">setTerminalChars</span>(<span class="type">std::string_view</span> <i>chars</i>)</h3>
<p>设置终结符 <i translate="no">chars</i>, 默认为 '\n'(0x0A), 设置这个属性值不会影响它是否被使用.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#terminalChars" translate="no">terminalChars</a>.</p>
<!-- @@@setTerminalChars -->
<!-- $$$setTerminalCharsEnable[overload1]$$$setTerminalCharsEnablebool -->
<h3 class="fn" translate="no" id="setTerminalCharsEnable"><span class="type">void</span> Attribute::<span class="name">setTerminalCharsEnable</span>(<span class="type">bool</span> <i>enable</i>)</h3>
<p>设置终止符是否启用 <i translate="no">enable</i> 默认为启用，该属性仅对读取数据有效.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#terminalCharsEnable" translate="no">terminalCharsEnable</a>.</p>
<!-- @@@setTerminalCharsEnable -->
<!-- $$$setTimeout[overload1]$$$setTimeoutconststd::chrono::milliseconds& -->
<h3 class="fn" translate="no" id="setTimeout"><span class="type">void</span> Attribute::<span class="name">setTimeout</span>(const <span class="type">std::chrono::milliseconds</span> &amp;<i>timeout</i>)</h3>
<p>设置通信超时时间 <i translate="no">timeout</i>.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#timeout" translate="no">timeout</a>.</p>
<!-- @@@setTimeout -->
<!-- $$$stopBits[overload1]$$$stopBits -->
<h3 class="fn" translate="no" id="stopBits"><span class="type"><a href="openvisa.html#StopBits-enum" translate="no">OpenVisa::StopBits</a></span> Attribute::<span class="name">stopBits</span>() const</h3>
<p>返回停止位, 仅串口连接时有效，默认为 <a href="openvisa.html#StopBits-enum" translate="no">StopBits::One</a>.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setStopBits" translate="no">setStopBits</a>.</p>
<!-- @@@stopBits -->
<!-- $$$terminalChars[overload1]$$$terminalChars -->
<h3 class="fn" translate="no" id="terminalChars">const <span class="type">std::string</span> &amp;Attribute::<span class="name">terminalChars</span>() const</h3>
<p>返回终结符.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setTerminalChars" translate="no">setTerminalChars</a>.</p>
<!-- @@@terminalChars -->
<!-- $$$terminalCharsEnable[overload1]$$$terminalCharsEnable -->
<h3 class="fn" translate="no" id="terminalCharsEnable"><span class="type">bool</span> Attribute::<span class="name">terminalCharsEnable</span>() const</h3>
<p>返回终止符是否启用，该属性仅对读取数据有效.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setTerminalCharsEnable" translate="no">setTerminalCharsEnable</a>.</p>
<!-- @@@terminalCharsEnable -->
<!-- $$$timeout[overload1]$$$timeout -->
<h3 class="fn" translate="no" id="timeout">const <span class="type">std::chrono::milliseconds</span> &amp;Attribute::<span class="name">timeout</span>() const</h3>
<p>返回通信超时时间.</p>
<p><b>See also </b><a href="openvisa-object-attribute.html#setTimeout" translate="no">setTimeout</a>.</p>
<!-- @@@timeout -->
</div>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> OpenVisa
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/> </div>
</body>
</html>
